
import Vue from 'vue'


import hljs from 'highlight.js' //导入代码高亮文件
// import 'highlight.js/styles/github-dark.css'  //导入代码高亮样式
import '../assets/css/github-dark.css'


//自定义一个代码高亮指令
Vue.directive('highlight',function (el) {
    let highlight = []
    highlight.push(...el.querySelectorAll('code'));
    highlight.push(...el.querySelectorAll('pre'));
    highlight.forEach((block)=>{
        hljs.highlightBlock(block)
        block.style.padding = '10px';
        block.style.borderRadius = '10px';
    })
});